﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NewsGridControl.ascx.cs" Inherits="Web.Views.Admin.Controls.News.NewsGridControl" %>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    CancelSelectOnNullParameter="False" SelectCommand="
select
	&quot;TT_News&quot;.&quot;NewsID&quot; &quot;NewsID&quot;
	,&quot;TT_News&quot;.&quot;Title&quot; &quot;Title&quot;
	,&quot;TT_News&quot;.&quot;Txtpic&quot; &quot;Txtpic&quot;
	,&quot;TT_News&quot;.&quot;ShowImgUrl&quot; &quot;ShowImgUrl&quot;
	,&quot;TT_News&quot;.&quot;AreaID&quot; &quot;AreaID&quot;
	,&quot;TT_News&quot;.&quot;CategoryID&quot; &quot;CategoryID&quot;
	,&quot;TT_News&quot;.&quot;Author&quot; &quot;Author&quot;
	,&quot;TT_News&quot;.&quot;Source&quot; &quot;Source&quot;
	,&quot;TT_News&quot;.&quot;ContentInfo&quot; &quot;ContentInfo&quot;
	,&quot;TT_News&quot;.&quot;Hits&quot; &quot;Hits&quot;
	,&quot;TT_News&quot;.&quot;NewsDate&quot; &quot;NewsDate&quot;
	,&quot;TT_News&quot;.&quot;CreateOn&quot; &quot;CreateOn&quot;
from &quot;dbo&quot;.&quot;TT_News&quot; &quot;TT_News&quot;
order by &quot;TT_News&quot;.&quot;Title&quot;" 
   
    ConnectionString='<%$ ConnectionStrings:ConnectionString %>'></asp:SqlDataSource>
<div class="TaskList">
  <div class="Task">Click <asp:HyperLink ID="NewLink" runat="server" Text="here" NavigateUrl="~/Views/Admin/TT_News/New.aspx" /> to create a new tt news record.</div>
  <div class="Task" id="ShowFilterTask" runat="server">
        Apply a
        <asp:LinkButton ID="ShowFilterLink" runat="server" Text="filter" OnClick="ShowFilterLink_Click" />
        to narrow down the record set.
      </div>
</div>
<table id="FilterTable" runat="server" visible="false">
  <tr>
    <td>
      <asp:DropDownList ID="FilterField" runat="server">
        <asp:ListItem Value="Title,String">Title</asp:ListItem>
        <asp:ListItem Value="Txtpic,Boolean">Txtpic</asp:ListItem>
        <asp:ListItem Value="ShowImgUrl,String">Show Img Url</asp:ListItem>
        <asp:ListItem Value="AreaID,Int32">Area#</asp:ListItem>
        <asp:ListItem Value="CategoryID,Int32">Category#</asp:ListItem>
        <asp:ListItem Value="Author,String">Author</asp:ListItem>
        <asp:ListItem Value="Source,String">Source</asp:ListItem>
        <asp:ListItem Value="ContentInfo,String">Content Info</asp:ListItem>
        <asp:ListItem Value="Hits,Int32">Hits</asp:ListItem>
        <asp:ListItem Value="NewsDate,DateTime">News Date</asp:ListItem>
      </asp:DropDownList>
    </td>
    <td>
      <asp:TextBox ID="FilterValue" runat="server" Columns="30" />
    </td>
    <td>
      <asp:LinkButton ID="ApplyFilterLink" runat="server" Text="Apply" OnClick="ApplyFilterLink_Click" ToolTip="Apply Filter" />
      <asp:LinkButton ID="CancelFilterLink" runat="server" Text="Cancel" OnClick="CancelFilterLink_Click" ToolTip="Clear Filter" />
    </td>
  </tr>
</table>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AllowSorting="True"  AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
    EnableSortingAndPagingCallbacks="True" DataKeyNames="NewsID" PageSize="30"><Columns>
    <%--<asp:BoundField DataField="ContentInfo" HeaderText="Content Info" />--%>
    <asp:HyperLinkField DataTextField="Title" HeaderText="Title" DataNavigateUrlFields="NewsID" SortExpression="Title" />
    <asp:CheckBoxField DataField="Txtpic" HeaderText="Txtpic" SortExpression="Txtpic" />
    <asp:BoundField DataField="AreaID" HeaderText="Area#" SortExpression="AreaID" />
    
    <asp:BoundField DataField="CategoryID" HeaderText="Category#" SortExpression="CategoryID" />
    <asp:BoundField DataField="Author" HeaderText="Author" SortExpression="Author" />
    <asp:BoundField DataField="Source" HeaderText="Source" SortExpression="Source" />
    <asp:BoundField DataField="Hits" HeaderText="Hits" SortExpression="Hits" />
    <asp:BoundField DataField="NewsDate" HeaderText="News Date" SortExpression="NewsDate" HtmlEncode="false" DataFormatString="{0:d}" /></Columns></asp:GridView>